﻿@{
    ViewBag.Title = "点检记录";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
    <script src="~/Areas/Dev/ViewModels/Dev.viewModel.search.js"></script>
    <script type="text/javascript">
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            var viewModel = function(data){ 
                var self = this;
                Dev.viewModel.search.apply(self,arguments);
            }
            ko.bindingViewModel(new viewModel(data));

            //格式化checkbox true false
            frmatCheckboxs = function (value) {
                var checked = (value || 'false').toString() == 'passed';
                return utils.formatString('<img value={0} src="/Content/images/{1}"/>', checked, checked ? "checkmark.gif" : "checknomark.gif");
            };
    </script>
}

<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a>
    <a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a>
    <a id="a_edit" href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a>
    <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a>
    <a id="a_audit" href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick" title="审核">审核</a>
    <a id="a_export" href="#" class="easyui-splitbutton" data-options="menu:'#dropdown',iconCls:'icon-download'">导出</a>
</div>

<div id="dropdown" style="width: 100px; display: none;">
    <div data-options="iconCls:'icon-ext-xls'" suffix="xls" data-bind="click:downloadClick">Excel2003</div>
    <div data-options="iconCls:'icon-page_excel'" suffix="xlsx" data-bind="click:downloadClick">Excel2007</div>
    <div data-options="iconCls:'icon-ext-doc'" suffix="doc" data-bind="click:downloadClick">Word2003</div>
</div>

<div id="condition" class="container_12" style="position:relative;">

    <div class="grid_1 lbl">点检单号</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Djjl_BillNo" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Djjl/getbillno'" /></div>
    <div class="grid_1 lbl">开始日期</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Djjl_Kssj" class="z-txt easyui-daterange" /></div>
    <div class="clear"></div>
    <div class="grid_1 lbl">点检人</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Djjl_Djr" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Djjl/GetDoNames'" /></div>
    <div class="grid_1 lbl">审核人</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.ApprovePerson" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Djjl/GetApNames'" /></div>

    <div class="clear"></div>
    <div class="prefix_9" style="position:absolute;top:5px;height:0;">
        <a id="a_search" href="#" class="button button-blue" style="margin:0 15px;" data-bind="click:searchClick">查询</a>
        <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>
    </div>
</div>

<table id="gridlist" data-bind="datagrid:grid">
    <thead>
        <tr>
            <th field="Djjl_BillNo" sortable="true" align="left" width="90">记录编号</th>
            <th field="Sbda_Sbmc"  sortable="true" align="left" width="100">设备名称</th>
            <th field="Djjl_Bmmc"  sortable="true" align="left" width="100">部门名称</th>
            <th field="Djjl_Djr"  sortable="true" align="left" width="80">点检人</th>
            <th field="Djjl_Kssj"  sortable="true" align="center" width="90" formatter="com.formatDate">开始日期</th>
            <th field="Djjl_Jssj"  sortable="true" align="center" width="90" formatter="com.formatDate">结束日期</th>
            <th field="Djjl_Djgs"  sortable="true" align="right" width="65">点检工时</th>
            <th field="Djjl_Tjgs"  sortable="true" align="right" width="65">停机工时</th>
            <th field="Djjl_Djfy"  sortable="true" align="right" width="75">点检费用</th>
            <th field="Djjl_Djrs"  sortable="true" align="right" width="65">点检人数</th>
            <th field="Djjl_Djnr"  sortable="true" align="left" width="320">点检内容</th>
            <th field="Djjl_Jtyq"  sortable="true" align="left" width="320">具体要求</th>
           @* <th field="Djjl_Ysbz"  sortable="true" align="left" width="80" formatter="com.formatCheckbox" >验收标志</th>*@
            <th field="Djjl_Djly"  sortable="true" align="left" width="75">单据来源</th>
            <th field="CreatePerson"  sortable="true" align="left" width="80">创建人	</th>
            <th field="CreateDate"  sortable="true" align="center" width="90" formatter="com.formatDate">创建日期</th>
            <th field="UpdatePerson"  sortable="true" align="left" width="80">更新人	</th>
            <th field="UpdateDate"  sortable="true" align="center" width="90" formatter="com.formatDate">更新日期</th>
            <th field="ApproveState"  sortable="true" align="center" width="65" formatter="frmatCheckboxs" >审批状态</th>
            <th field="ApprovePerson"  sortable="true" align="left" width="80">审批人</th>
            <th field="ApproveDate"  sortable="true" align="center" width="90" formatter="com.formatDate">审批日期</th>
            <th field="ApproveRemark"  sortable="true" align="left" width="320">审批意见</th>
            <th field="Djjl_Remark"  sortable="true" align="left" width="320">备注说明</th>
        </tr>
    </thead>
</table>

